package cn.hyp.bantang.module.finance.dal.mysql.basegs;

import cn.hyp.bantang.framework.common.pojo.PageResult;
import cn.hyp.bantang.framework.mybatis.core.mapper.BaseMapperX;
import cn.hyp.bantang.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.hyp.bantang.module.finance.controller.admin.basegs.vo.BaseGsPageReqVO;
import cn.hyp.bantang.module.finance.dal.dataobject.basegs.BaseGsDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 公司基本信息 Mapper
 *
 * @author 半唐
 */
@Mapper
public interface BaseGsMapper extends BaseMapperX<BaseGsDO> {

    default PageResult<BaseGsDO> selectPage(BaseGsPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BaseGsDO>()
                .likeIfPresent(BaseGsDO::getSecName, reqVO.getSecName())
                .betweenIfPresent(BaseGsDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(BaseGsDO::getSecCode));
    }

}